<%--
    Document   : TimKiemSanPham
    Created on : Apr 23, 2011, 10:44:41 PM
    Author     : MongKieu
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<div style="padding-top:10px; padding-left:10px; clear:both; height:auto">
    <div id="listHeader" style="cursor:pointer;width:auto;border-bottom:#d6d6d6 1px dotted;" >
        <h3>KẾT QUẢ</h3>
    </div>
    <div style="background-color:#f4efef;width:auto; padding-bottom:3px; padding-top:2px; height:16px" >
        Tìm thấy <span style="color:black">${soLuongSanPham}</span> mục.
        <c:if test="${soLuongSanPham != 0}">
            Trang ${trangHienTai}/${soTrang}.
        </c:if>
    </div>
    <div>
        <br />
        <c:if test="${!empty(listSanPham)}">
            <c:forEach var="sanPham" items="${listSanPham}" varStatus="STT">
                <table>
                    <tr>
                        <td valign="top" >
                            <img src="${sanPham.hinhAnhMinhHoa}"  class="frameLarge" />
                        </td>
                        <td valign="top" style="padding-left:3px">
                            <span class="linkitem" ><a href='ChiTietSanPham.htm?ISBN=${sanPham.ISBN}'><b>${sanPham.tenSanPham}</b> </a>
                                <c:if test="${sanPham.soLuongDangCo==0}">
                                    <strong style="color: red;">(hết hàng)</strong>
                                </c:if>
                                <br />
                            </span>
                            <span style="color:#000;"> <a href='#'>${sanPham.nhaXuatBan.tenNhaSanXuat}</a></span>
                            <br/>
                            <span><b>ISBN</b>: ${sanPham.ISBN}</span>
                            <br/>
                            <span><b>Giá: </b><span style="color:#8a3c3d;">${sanPham.giaBanHienTai} đ</span></span>
                            <br />
                            ${sanPham.moTaSanPham}<span class='linkitem'> <a href= 'ChiTietSanPham.htm?ISBN=${sanPham.ISBN}'> ... </a></span>
                        </td>
                    </tr>
                </table>
            </c:forEach>
        </c:if>
    </div>
    <div style="width:auto; padding-bottom:3px; padding-top:2px; height:16px" >
        <center>
            <span class="linkitem" style="cursor:pointer;padding-right:10px">
                <c:if test="${bookKind eq 0}">
                    <c:forEach var="trang" begin="1" end="${soTrang}" step="1">
                        <a href="TimKiemSanPham.htm?MaNhomSanPham=${nhomSanPham}&TheLoai=${theLoai}&Trang=<c:out value="${trang}"/>">
                            <c:if test="${trang eq trangHienTai}">
                                <b> [<c:out value="${trang}"/>]</b>
                            </c:if>
                            <c:if test="${trang != trangHienTai}">
                                <c:out value="${trang}"/>
                            </c:if>
                        </a>
                    </c:forEach>
                </c:if>
                <c:if test="${bookKind eq 1}">
                    <c:forEach var="trang" begin="1" end="${soTrang}" step="1">
                        <a href="TimKiemSanPham.htm?bookKind=${bookKind}&Trang=${trang}">
                            <c:if test="${trang eq trangHienTai}">
                                <b> [<c:out value="${trang}"/>]</b>
                            </c:if>
                            <c:if test="${trang != trangHienTai}">
                                <c:out value="${trang}"/>
                            </c:if>
                        </a>
                    </c:forEach>
                </c:if>
                <c:if test="${bookKind eq 2}">
                    <c:forEach var="trang" begin="1" end="${soTrang}" step="1">
                        <a href="TimKiemSanPham.htm?bookKind=${bookKind}&Trang=${trang}">
                            <c:if test="${trang eq trangHienTai}">
                                <b> [<c:out value="${trang}"/>]</b>
                            </c:if>
                            <c:if test="${trang != trangHienTai}">
                                <c:out value="${trang}"/>
                            </c:if>
                        </a>
                    </c:forEach>
                </c:if>
                 <c:if test="${bookKind eq 3}">
                    <c:forEach var="trang" begin="1" end="${soTrang}" step="1">
                        <a href="TimKiemSanPham.htm?bookKind=${bookKind}&Trang=${trang}">
                            <c:if test="${trang eq trangHienTai}">
                                <b> [<c:out value="${trang}"/>]</b>
                            </c:if>
                            <c:if test="${trang != trangHienTai}">
                                <c:out value="${trang}"/>
                            </c:if>
                        </a>
                    </c:forEach>
                </c:if>
                <c:if test="${bookKind eq 4}">
                    <c:forEach var="trang" begin="1" end="${soTrang}" step="1">
                        <a href="TimKiemSanPham.htm?EventID=TimKiemChinh&Trang=${trang}&maNhomSearch=${NhomSanPhamID}&SearchText=${SearchText}">
                           <c:if test="${trang eq trangHienTai}">
                                <b> [<c:out value="${trang}"/>]</b>
                            </c:if>
                            <c:if test="${trang != trangHienTai}">
                                <c:out value="${trang}"/>
                            </c:if>
                        </a>
                    </c:forEach>
                </c:if>
            </span>
        </center>
    </div>
</div>
